<template>
    <div class="userinfo-list">
        <div class="item-lr bd">
            <div class="left">姓名</div>
            <div class="right">{{name}}</div>
        </div>
        <div class="item-lr bd">
            <div class="left">性别</div>
            <div class="right">{{sex}}</div>
        </div>
        <div class="item-lr bd">
            <div class="left">国籍（区域）</div>
            <div class="right">中国大陆</div>
        </div>

        <div class="item-lr bd bmt">
            <div class="left">证件类型</div>
            <div class="right">身份证</div>
        </div><div class="item-lr">
            <div class="left">证件号码</div>
            <div class="right">{{idcard}}</div>
        </div>

        <router-link to="/userinfoaddress" class="item-lr bmt address">
            <div class="left">所在区域</div>
            <div class="right"><span>{{address}}</span><i class="iconfont">&#xe871;</i></div>
        </router-link>
    </div>
</template>

<script>
import Header from '../common/header';
import axios from 'axios';
import { MessageBox, Popup } from 'mint-ui';
export default {
    data () {
        return {
            name: '',
            sex: '',
            country: '',
            idcard: '',
            address: ''
        }
    },
    components: {
        'h-header': Header
    },
    mounted() {
        const vm = this;
        let url = window.location.href;
        vm.wxShare(url);
    },
    created () {
        const vm = this;
        axios.post('/Weixin/Member/memberDetail',{}).then(res=>{
            const data = res.data;
            console.log(data);
            if(data.code==1){
                vm.name= data.data.name;
                vm.idcard = data.data.idNumber.substr(0,1)+'****************'+data.data.idNumber.substr(17);
                if( data.data.gender=='male'){
                    vm.sex = '男';
                }else if( data.data.gender=='famale'){
                    vm.sex = '女';
                }else {
                    vm.sex = '未知';
                }
                 vm.address = data.data.address;

            }else {
                MessageBox.alert(data.msg)
            }
        }).catch(()=>{
            MessageBox.alert('网络错误');
        })
    },
    methods: {
        
    }
}
</script>

<style>

</style>
